﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UtilZ.Dotnet.Ex.ValueDescription
{
    /// <summary>
    /// 扩展描述接口
    /// </summary>
    public interface IExtendDescription
    {
        /// <summary>
        /// 尝试获取扩展值对应的名称[获取成功返回true,获取失败返回false]
        /// </summary>
        /// <param name="value">值</param>
        /// <param name="group">描述组</param>
        /// <param name="name">值对应的名称</param>
        /// <returns>获取成功返回true,获取失败返回false</returns>
        bool TryGetName(object value, IValueDescriptionGroup group, out string name);

        /// <summary>
        /// 尝试获取扩展值对应的描述[获取成功返回true,获取失败返回false]
        /// </summary>
        /// <param name="value">值</param>
        /// <param name="group">描述组</param>
        /// <param name="des">值对应的描述</param>
        /// <returns>获取成功返回true,获取失败返回false</returns>
        bool TryGetDescription(object value, IValueDescriptionGroup group, out string des);






        /// <summary>
        /// 根据名称获取值(获取成功返回true;失败返回false)
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="group">描述组</param>
        /// <param name="value">值</param>
        /// <returns>获取成功返回true;失败返回false</returns>
        bool TryGetValueByName(string name, IValueDescriptionGroup group, out object value);

        /// <summary>
        /// 根据值描述获取值(获取成功返回true;失败返回false)
        /// </summary>
        /// <param name="des">值描述</param>
        /// <param name="group">描述组</param>
        /// <param name="value">值</param>
        /// <returns>获取成功返回true;失败返回false</returns>
        bool TryGetValueByDescription(string des, IValueDescriptionGroup group, out object value);


    }
}